namespace basicData{

    /**功能开放表配置数据管理*/
    export class ModelconfConfMgr {
    
        private static _instance: ModelconfConfMgr ;
        public static get instance():ModelconfConfMgr{
			if(!ModelconfConfMgr._instance){
			  ModelconfConfMgr._instance = new ModelconfConfMgr();
			} 
            return ModelconfConfMgr._instance;
        }
        
        private _confDict:{[key: number]: ModelconfConf} ;

        public data:any ;
		private _dicSystemid:any ;
		private _conflistSystemidArr:ModelconfConf[];

        constructor(){ 
            this._confDict = {};
            var conf:any = GameConfData.modelConf;
            this.data = conf.data ;
			this._dicSystemid = conf.dicSystemid;

        }
		public getConfBySystemid(systemid:number):ModelconfConf{ 
			return this.getConf(<number>this._dicSystemid[systemid]);

		}
		public getConfsBySystemid():Array<ModelconfConf>{ 
			if(!this._conflistSystemidArr){
				this._conflistSystemidArr = new Array();
				for(var id in this._dicSystemid){
					this._conflistSystemidArr.push(this.getConf(<number>this._dicSystemid[id]));
				}
			}
			return this._conflistSystemidArr;
		}


        private getConf(index:number):ModelconfConf {  
            if(!this._confDict[index]){
                this._confDict[index] = new ModelconfConf(this.data[index]);
            } 
            return  this._confDict[index];   
        }

    } 
    
    /**功能开放表配置数据*/
    export class ModelconfConf { 
    
        data:Array<any> ;
        constructor(data:Array<any>){ 
            this.data = data; 
        }

		/**系统ID*/
		get systemid():number{ return this.data[0]; }
		/**系统描述*/
		get systemdescribe():string{ return this.data[1]; }
		/**UI显示条件*/
		get iconopen():string{ return this.data[2]; }
		/**功能开放条件*/
		get systemopen():string{ return this.data[3]; }
		/**有显示时功能还未开放弹出提示*/
		get hint():string{ return this.data[4]; }

    }
}
import ModelconfConfMgr = basicData.ModelconfConfMgr;
import ModelconfConf = basicData.ModelconfConf;
